﻿<!DOCTYPE html>
<html lang="en">
    <head>
        <meta name="viewport" content="initial-scale=1.0, user-scalable=no">
        <meta charset="utf-8" />

        @*TODO: Find another way to know in which View you are!*@
        @if(ViewBag.Title == "Scheduler" || ViewBag.Title == "tDonkey Schedule"){
            <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
            <script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false"></script>
	        <script type="text/javascript" src="../../Scripts/jquery-latest.js"></script>
            <script type="text/javascript" src="../../Scripts/jquery.ba-resize.js"></script>
            <script type="text/javascript" src="../../Scripts/bootstrap-tooltip.js"></script>
            <script type="text/javascript" src="../../Scripts/bootstrap-collapse.js"></script>
            <script type="text/javascript" src="https://www.google.com/jsapi?autoload={'modules':[{'name':'visualization',
                'version':'1','packages':['timeline']}]}"></script>

            <script>
            jQuery($("td").click(function (e) {
                //$(this).attr("innerHTML", "border-color:green");
                alert('aaa');
                /*var id = $(this).closest("table").id;
                if (currentTD != null && id == 'scheduleTable') {
                    $(this).attributeStartsWith("style").borderColor = 'green';
                }*/
            }));
            </script>
        }
        else
        { //TODO: put the following js just in related Views.
            <script type="text/javascript" src="../../Scripts/tDonkeyCourses.js"></script>
            <link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css">
            <script src="http://code.jquery.com/jquery-1.9.1.js"></script>
            <script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script> 
            <script>
                jQuery(function ($) {
                    $(function () {
                        $("#examDate").datepicker();
                    });
                });
            </script>
        }
        
        <script type="text/javascript" src="../../Scripts/tDonkeyScheduler.js"></script>
        <script type="text/javascript" src="../../Scripts/syncWithGoogleCalendar.js"></script>
        <script type="text/javascript" src="../../Scripts/signin.js"></script>
        <title>@ViewBag.Title - tDonkey</title>
        <link href="~/favicon.ico" rel="shortcut icon" type="image/x-icon" />
        <meta name="viewport" content="width=device-width" />
        @Styles.Render("~/Content/css")
        @Scripts.Render("~/bundles/modernizr")
    </head>
    @if (ViewBag.Title == "Scheduler")
    {
        @:<body onload="loadScheduleTable(0);">
    }
    else if (ViewBag.Title == "tDonkey Schedule")
    {
        @:<body onload="var x = @Json.Encode(ViewBag.j); scheduleViewer((x));">
    }
    else
    {
        @:<body>
    }
        <header>
            <div class="content-wrapper">
                <div class="float-left">
                    <p class="site-title">@Html.ActionLink("tDonkey", "Index", "Home")</p>
                </div>
                <div class="float-right">
                    <nav>
                        <ul id="menu">
                            <li>@Html.ActionLink("Home", "Index", "Home")</li>
                            <li>@Html.ActionLink("Courses", "Index", "Courses")</li>
                            <li>@Html.ActionLink("My Courses", "Select", "Courses")</li>
                            <li>@Html.ActionLink("Scheduler", "Index", "Scheduler")</li>
                            <li>@Html.ActionLink("About", "About", "Home")</li>
                            <li>@Html.ActionLink("Contact", "Contact", "Home")</li>
                        </ul>
                    </nav>
                </div>
            </div>
        </header>
        <div id="body">
            @RenderSection("featured", required: false)
            <section class="content-wrapper main-content clear-fix">
                @RenderBody()
            </section>
        </div>
        <footer>
            <div class="content-wrapper">
                <div class="float-left">
                    <p>&copy; @DateTime.Now.Year - tDonkey, By Ahmad Soboh & Ahmad Assadi.</p>
                </div>
            </div>
        </footer>

        @Scripts.Render("~/bundles/jquery")
        @RenderSection("scripts", required: false)
    </body>
</html>
